import React from "react";
import { render, hydrate } from "react-dom";
import App from "./App";
import { Router } from "react-router-dom";

import { history } from "@/utils/history";

const rootEle = document.getElementById("root");

if (rootEle?.hasChildNodes) {
  hydrate(
    <React.StrictMode>
      <Router history={history}>
        <App />
      </Router>
    </React.StrictMode>,
    rootEle
  );
} else {
  render(
    <React.StrictMode>
      <Router history={history}>
        <App />
      </Router>
    </React.StrictMode>,
    rootEle
  );
}
